Skip to content

Conversation

@heiytor
Copy link
Contributor

@heiytor heiytor commented Mar 8, 2025

No description provided.

@heiytor heiytor self-assigned this Mar 8, 2025
@heiytor heiytor requested review from a team as code owners March 8, 2025 18:54
@heiytor heiytor marked this pull request as draft March 8, 2025 18:55
@heiytor heiytor force-pushed the feat/postgres branch 2 times, most recently from b298f40 to fb0dd93 Compare March 25, 2025 21:04
@heiytor heiytor force-pushed the feat/postgres branch 5 times, most recently from 8bc3d90 to 1fb1bed Compare May 12, 2025 07:32
@heiytor heiytor force-pushed the feat/postgres branch 2 times, most recently from 1e75d09 to 25d8b30 Compare May 27, 2025 12:48
@heiytor heiytor force-pushed the feat/postgres branch 2 times, most recently from 6c1cc16 to 6124534 Compare September 26, 2025 11:35
@heiytor heiytor changed the base branch from master to refactor/api/store-save-and-delete-operations October 17, 2025 22:59
@heiytor heiytor force-pushed the feat/postgres branch 3 times, most recently from 50b34d3 to 55cb58f Compare October 17, 2025 23:22
@heiytor heiytor force-pushed the refactor/api/store-save-and-delete-operations branch from ea31f49 to 3017588 Compare October 20, 2025 02:03
Base automatically changed from refactor/api/store-save-and-delete-operations to master October 22, 2025 12:51
@heiytor heiytor force-pushed the feat/postgres branch 2 times, most recently from 9eea0fb to dcde12b Compare October 23, 2025 11:59
@heiytor heiytor changed the base branch from master to refactor/api/session-store October 23, 2025 12:00
@heiytor heiytor force-pushed the feat/postgres branch 4 times, most recently from 6ce21bc to 51e99a2 Compare October 23, 2025 14:32
@heiytor heiytor force-pushed the refactor/api/session-store branch 4 times, most recently from 99e1620 to 943603e Compare October 29, 2025 16:17
Base automatically changed from refactor/api/session-store to master October 29, 2025 17:30
@otavio otavio self-requested a review October 30, 2025 13:13
@heiytor heiytor force-pushed the feat/postgres branch 11 times, most recently from fcf23f3 to 807b0e8 Compare November 4, 2025 16:56
Add support for pluggable database backends via SHELLHUB_DATABASE env
var. MongoDB service moved from main docker-compose.yml to separate
compose files.

- Add SHELLHUB_DATABASE env var (defaults to mongo)
- Add logic in bin/utils to load database-specific compose files
- Remove hardcoded mongo service from main docker-compose.yml
Implement complete PostgreSQL support as an alternative to MongoDB,
allowing users to select their preferred database backend via
SHELLHUB_DATABASE environment variable.

Infrastructure:
- Add PostgreSQL 18.0 service in docker-compose.postgres.yml
- Configure PostgreSQL environment variables (username, password,
database)
- Update bin/utils to recognize 'postgres' as valid database option
- Add PostgreSQL healthcheck configuration

Store Implementation:
- Create pg store package with bun ORM and pgx driver
- Implement all CRUD operations for all store interfaces
- Add entity package with complete model-to-database mappings
- Create 10 database migrations covering all tables and relations
- Implement query system with pagination, sorting, and filtering
- Add internal filter parser for complex queries (contains, eq, bool,
gt, ne)
- Implement SQL error mapping and handling utilities
- Create transaction support with bun

Entities and Relations:
- Namespaces, Users, Memberships
- Devices with status tracking
- API Keys, Public Keys, Private Keys
- Tags with many-to-many relations (device-tags, publickey-tags)
- Sessions and Tunnels

Testing Infrastructure:
- Add testcontainers-based integration tests
- Create YAML fixture system for test data
- Implement comprehensive unit tests for all store operations
- Add database test utilities and helpers

Integration:
- Update api/server.go to support database selection
- Update cli/main.go to support database selection
- Add bun, pgx, and testcontainers dependencies
- Maintain backward compatibility with existing MongoDB implementation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants